import styles from './styles.module.scss'

import Link from 'next/link'

const ClassifyNav = ({ link, list, children, pathValue }) => {
  return (
    <section className={styles.links}>
      <nav className={styles.navBlock}>
        {list?.map(row => (
          <Link href={`${link}${Reflect.get(row, pathValue)}`} key={row?.id} target="_blank">
            {children(row, styles)}
          </Link>
        ))}
      </nav>
    </section>
  )
}
ClassifyNav.defaultProps = {
  link: "/classify/",
  pathValue: "id"
}


export default ClassifyNav